package com.hongxun.design.activitys;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.hongxun.design.MyApp;
import com.hongxun.design.R;
import com.hongxun.design.constant.Constant;
import com.hongxun.design.interfaces.HeadSecond;
import com.hongxun.design.listeners.ListenerSet;
import com.hongxun.design.mytools.IconSourse;
import com.hongxun.design.mytools.IntentToActivity;
import com.hongxun.design.mytools.MString;
import com.hongxun.design.mytools.SetTypeface;
import com.hongxun.design.mytools.ToastShow;
import com.hongxun.design.ui.headandbottonpanel.HeadSecondControlPanel;
import com.hongxun.design.utils.DataUtil;

/**
 * Created by zerdoor_pc on 2016/6/24.
 * 同步
 */
public class SynchronizationActivity extends BaseActivity implements HeadSecond {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_synchronization);
        findBar();
        findView();
    }

    @Override
    public void findBar() {
        HeadSecondControlPanel headsecond_layout = (HeadSecondControlPanel) findViewById(R.id.synchronization_layout);
        headsecond_layout.initHeadPanel(DataUtil.getsecondbean("", View.GONE, R.color.bar_right, ListenerSet.back, "同步", R.color.title, View.VISIBLE, IconSourse.BACK + "", View.VISIBLE));
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void findView() {
        super.findView();
        TextView face_load_icon = (TextView) findViewById(R.id.face_load_icon);
        TextView intnet_load_icon = (TextView) findViewById(R.id.intnet_load_icon);

        TextView face_load_right = (TextView) findViewById(R.id.face_load_right);
        TextView intnet_load_right = (TextView) findViewById(R.id.intnet_load_right);

        SetTypeface.set(face_load_icon, IconSourse.KUAICHUAN);
        SetTypeface.set(intnet_load_icon, IconSourse.sendup);

        SetTypeface.set(face_load_right, IconSourse.RIGHTARROW);
        SetTypeface.set(intnet_load_right, IconSourse.RIGHTARROW);
    }

    /**点击事件**/

    /**
     * 面对面快传*
     */
    public void facingEach(View v) {
        IntentToActivity.intent(this, FacingEachActivity.class);
    }

    /**
     * 网络上传*
     */
    public void upLoad(View v) {
        if (MyApp.isOnLine){
            Bundle bundle= new Bundle();
            bundle.putInt(MString.TYPE, Constant.NETLOAD);
            IntentToActivity.intent(this,SelectProjectActivity.class,bundle);
        }else{
            ToastShow.showShort(this, "离线模式下无法上传项目！");
        }
        //ToastShow.showShort(this, "此功能暂未开通！");
    }
}
